<template>
    <div class="card-box">
        <el-row>
            <el-col :md="20">
                <el-form :inline="true" :model="formInline" class="demo-form-inline">
                    <el-form-item label="用户业务模式搜索：" class="mt_5">
                        <el-input v-model="formInline.user" placeholder="用户业务模式名称"></el-input>
                    </el-form-item>
                    <el-button type="primary" @click="selectCarrierName">
                        <i class="el-icon-search"></i>
                    </el-button>
                    <el-button type="primary" @click="getCarrierData">
                        <i class="el-icon-refresh"></i>
                    </el-button>
                    <el-button type="primary" @click="dialogVisible = true">刷选</el-button>
                </el-form>
            </el-col>
            <el-dialog title="用户业务模式查询" :visible.sync="dialogVisible" width="40%">
                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm">
                    <el-form-item label="市场类型：">
                        <el-radio-group v-model="ruleForm.resource">
                            <el-radio :label="1">公共市场</el-radio>
                            <el-radio :label="2">企业市场</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-form>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="dialogVisible = false">取 消</el-button>
                    <el-button type="primary" @click="selectCarrier">查询</el-button>
                </span>
            </el-dialog>
            <el-col :md="4" class="float-right">
                <router-link to="/user_business_types/new">
                    <el-button type="primary">新增</el-button>
                </router-link>
            </el-col>
        </el-row>
        <el-table :data="tableData" stripe border style="width: 100%">
        <el-table-column prop="name" label="用户业务模式名称">
        </el-table-column>
        <el-table-column prop="code" label="CODE" width="70">
        </el-table-column>
        <el-table-column prop="type" label="市场类型" width="80">
        </el-table-column>
        <el-table-column prop="can_num" label="所属套餐数量" width="110">
        </el-table-column>
        <el-table-column prop="num1" label="所属移动卡号数量" width="140">
        </el-table-column>
        <el-table-column prop="num2" label="所属电信卡号数量" width="140">
        </el-table-column>
        <el-table-column prop="num3" label="所属联通卡号数量" width="140">
        </el-table-column>
        <el-table-column prop="all_num" label="所属卡号总数" width="120">
        </el-table-column>
        <el-table-column prop="methods" label="操作" width="100">
            <template slot-scope="scope">
                <el-button size="mini" @click="editSingData(scope.row)">编辑</el-button>
            </template>
        </el-table-column>
      </el-table>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                formInline: {
                    user: ''
                },
                ruleForm: {
                    resource: 1
                },
                dialogVisible: false,
                tableData: [
                    {
                        id: 1,
                        name: '月流量叠加(平台-平台)',
                        code: 'C0001',
                        type: '公众市场',
                        can_num: 29,
                        num1: 2,
                        num2: 13,
                        num3: 0,
                        all_num: 18
                    }
                ]
            }
        },
        methods: {
            editSingData(goods) {
                this.$router.push({
                    path: `/user_business_types/edit`
                })
            }
        }
    }
</script>

<style scoped>
    
</style>